function ecm = main( warray )
    global patterns solutions;

    wf{1} = reshape( warray(1:60) , 20 , 3 );
    wf{2} = reshape( warray(61:480) , 20 , 21 );
    wf{3} = reshape( warray(481:501) , 1 , 21 );

    % para hacer lo inverso usar esto: longarray = [reshape(wf{1},1,60) reshape(wf{2},1,420) reshape(wf{3},1,21)];

    %data = load('patternsAndSolutions.txt');
    %patterns = [data(:,1,:)';data(:,2,:)'];
    %solutions = data(:,3,:)';

    ecm = errorFunction( patterns, wf, solutions );
    ecm = 1/ecm;
end